Skip to content

Conversation

dusan-exostellar
Copy link

Associated JIRA ticket number/Github issue number

Closes #164

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Continuous Integration

What were the changes?

NULL check environ before dereference.

Why are these changes needed?

To prevent dereferencing NULL pointer.

Updated CHANGELOG?

  • Yes
  • No, Does not apply to this PR.

Added/Updated documentation?

  • Yes
  • No, Does not apply to this PR.

Additional Checks

  • I have added tests relevant to the introduced functionality, and the unit tests are passing locally.
  • Any dependent changes have been merged.

@ghost
Copy link

ghost commented May 28, 2025

Can you please change the PR to move this check outside the ifdef?

if (environ == NULL) {

@ghost
Copy link

ghost commented May 28, 2025

One more thing, please squash the two commits together, after that lgtm

On UNIX, `clearenv` sets `environ` to NULL.
So, NULL is a valid value for `environ`.

Signed-off-by: Dušan Veljko <[email protected]>
@dusan-exostellar
Copy link
Author

One more thing, please squash the two commits together, after that lgtm

Done

@rocm-devops
Copy link
Contributor

Imported to ROCm/rocm-systems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue]: SIGSEGV during HIP initialization if environ is clearenv-ed
2 participants